<!DOCTYPE html>
<html lang="en">
<head>
    {{include file="lib/page_head" /}}
    <link href="../css/jquery.gritter.css" rel="stylesheet">
    <link href="../css/f.dialog.css" rel="stylesheet">
</head>

<body>



<!-- Preloader -->
<div id="preloader">
    <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
</div>

<section>
    {{include file="lib/page_left" /}}
    <div class="mainpanel">

        {{include file="lib/page_header" /}}
        <div class="contentpanel" >
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-btns">
                        <a href="" class="panel-close">×</a>
                        <a href="" class="minimize">−</a>
                    </div>
                    <h4 class="panel-title">充值卡充值</h4>
                </div>
                <div class="panel-body ">
                    <div id="info_list" class="form-inline">
                        <div class="btn-group">
                            <!--<button class="btn btn-primary" onclick="edit_info(0)">添加</button>-->
                            <!--<button class="btn btn-primary" onclick="del_info(0)">删除</button>-->
                            <button class="btn btn-primary" onclick="location.href = location.href;">刷新</button>
                        </div>
                    </div>
                    <div class="">
                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="width:100px;">普通卡号</label>
                            <div class="col-sm-6">
                                <textarea class="form-control" name="card_no_list" placeholder="一行一卡号"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="width:100px;">充值面额</label>
                            <div class="col-sm-6">
                                <select name="amount" class="form-control" >
                                    {{foreach $package_list as $val }}
                                    <option value="{{$val.basic_price }}">{{$val.name}}</option>
                                    {{/foreach}}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="width:100px;">余额</label>
                            <div class="col-sm-6">
                                {{$agent_info.balance/10000|sprintf='%.2f',###}}
                            </div>
                        </div>
                        <div>
                            <button class="btn btn-primary" onclick="charge(this);">充值</button>
                        </div>
                    </div>

                </div>
            </div>
        </div><!-- contentpanel -->
    </div><!-- mainpanel -->
    {{include file="lib/page_right" /}}

</section>

<script src="../js/jquery-1.11.1.min.js"></script>
<script src="../js/jquery-migrate-1.2.1.min.js"></script>
<script src="../js/jquery-ui-1.10.3.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.sparkline.min.js"></script>
<script src="../js/toggles.min.js"></script>
<script src="../js/jquery.cookies.js"></script>
<script src="../js/jquery.tmpl.js"></script>
<script src="../js/commen.js"></script>
<script src="../js/custom.js"></script>
<script src="../layui/layui.js"></script>
<script src="../js/jquery.gritter.min.js"></script>
<script src="../js/form.beautify.js?t={{$version}}"></script>
<link href="../css/ley.dialog.css" rel="stylesheet">
<script src="../js/ley.dialog.js?t={{$version}}"></script>

<script>
    layui.use('element', function() {
        var element = layui.element;
    });
    function charge(obj) {
        var card_no_list = $(obj).parent().parent().find("textarea[name='card_no_list']").val();
        var amount = $(obj).parent().parent().find("select[name='amount']").val();
        AjaxCommen("GET","/agentcommon/ajax_agent_card_charge",{card_no_list:card_no_list,amount:amount},function (msg) {
            if (!msg.error)
            {
               location.reload(true);
            }
        });
    }

</script>
</body>
</html>
